<?php
namespace Admin\Controller;
class  MessageController extends LoginController{
	
	public function __construct(){
		parent::__construct();
		$this->db = D("message");
		layout(FALSE);
	}
	
	/**
	 * 留言板列表
	 */
	public function lists(){
	
	$count = $this->db->count();
	$page = $this->getPage($count);
	$show = $page->show();
	$list = $this->db->order("creat_date desc")->limit($page->firstRow,$page->listRows)->select();
	$this->assign(array(
			'list'=>$list,
			'show'=>$show,
	));
	$this->display();
		
	}
	
	/**
	 * 删除消息
	 */
	public function messageDe(){
		if(!empty($_POST['id'])){
			$this->db->where("id=".$_POST['id'])->delete();
		}
		echo true;		
		exit();
	}
	
}



?>